package com.lw.smartdevice.mapper;

import com.lw.smartdevice.pojo.SysScene;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @author Administrator
 * @version 1.0
 * @description:
 * @date 2022/3/21 21:25
 */
public interface SysSceneMapper {
    
    @Insert("insert into sys_scene (scene_name,create_by,create_time) values (#{sceneName},#{createBy},#{createTime});")
    void addSysScene(SysScene sysScene);

    @Select("select * from sys_scene where create_by=#{userId} and scene_name=#{sceneName}")
    SysScene findByIdAndName(@Param("userId") Long userId, @Param("sceneName") String sceneName);

    @Update("update sys_scene set status=#{status}  where  scene_id=#{sceneId};")
    int updateScene(@Param("sceneId") Long sceneId,@Param("status") Long status);

    @Select("select * from sys_scene where scene_id=#{id};")
    SysScene findById(Long id);
}
